﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IBLL;

namespace BLL
{
    public class FollowBLL : IFollowBLL
    {
        public bool follow(int IdFrom, int IdTo)
        {
            bool validator = false;
            DAL.FollowsDAL followDal = (DAL.FollowsDAL)DALFAC.DataAccess.CreateFollows();
            if (followDal != null)
            {
                validator = followDal.Add(IdFrom, IdTo);
            }
            return validator;

        }

        public bool removeFollow(Model.Follows follow)
        {
            bool modifier = false;
            DAL.FollowsDAL followDal = (DAL.FollowsDAL)DALFAC.DataAccess.CreateFollows();
            if (null != followDal)
            {
                modifier = followDal.followIdDelete(follow.getFL_followId());
            }

            return modifier;
        }

        public List<Model.Follows> getMyFollows(int userId)
        {
            List<Model.Follows> list = new List<Model.Follows>();
            DAL.FollowsDAL followDal = (DAL.FollowsDAL)DALFAC.DataAccess.CreateFollows();
            if (null != followDal)
            {
                list = followDal.GetMyFollows(userId);
            }
            return list;
        }

        public List<Model.Follows> getFollowMes(int userId)
        {
            List<Model.Follows> list = new List<Model.Follows>();
            DAL.FollowsDAL followDal = (DAL.FollowsDAL)DALFAC.DataAccess.CreateFollows();
            if (null != followDal)
            {
                list = followDal.getFollowMes(userId);
            }
            return list;
        }
    }
}
